"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
console.log(1212);
function getadd(name, age) {
    if (age === void 0) { age = 20; }
    console.log(age);
    return name;
}
getadd("1");
function tsChong(str) {
    if (typeof str === "string") {
        console.log(str + "字符串");
    }
    else {
        console.log(str + "数字");
    }
}
tsChong(1, 1);
// ts 定义类的方法
var Person = /** @class */ (function () {
    function Person(n) {
        this.name = n;
    }
    Person.prototype.run = function () {
        console.log(this.name);
    };
    return Person;
}());
var a = new Person("刘涵");
a.run();
console.log(a.name);
// ts 继承 关键字 extends 和 super 两个关键词
var Web = /** @class */ (function (_super) {
    __extends(Web, _super);
    function Web(name) {
        return _super.call(this, name) || this;
    }
    return Web;
}(Person));
var w = new Web("张三");
w.run();
/**
 * name
 */
// public name() {
// }
//protected (自身还有子应用可以访问的属性) private (私有的 有且只有自己可以访问的属性) public (公有的 都可以访问)
// ts 的静态方法
var per = /** @class */ (function () {
    function per(name) {
        this.name = name;
    }
    per.text = function () {
        console.log(this.sex);
    };
    per.sex = "男";
    return per;
}());
per.text();
// 抽象类 abstract (关键字) 抽象类无法直接被实例化 --- 是用来定义标准的
var abs = /** @class */ (function () {
    function abs(name) {
        this.name = name;
    }
    return abs;
}());
var Wp = /** @class */ (function (_super) {
    __extends(Wp, _super);
    function Wp(na) {
        return _super.call(this, na) || this;
    }
    Wp.prototype.rea = function () {
        console.log(this.name);
    };
    return Wp;
}(abs));
var me = new Wp("我是刘涵");
me.rea();
console.log(111);
function pers(paramsList) {
    console.log(paramsList);
}
pers({
    num: 1,
    str: {
        name: "张三",
    },
});
var keysListFun = function (a, b) {
    return a + b;
};
console.log(keysListFun("张三", "李四"));
// 可索引接口
var suo1 = ["12"];
var userArr = ["1", "2"];
var userObj = {
    name: "1",
    age: "2",
};
var Dog = /** @class */ (function () {
    function Dog(name) {
        this.name = name;
    }
    Dog.prototype.eat = function () {
        console.log(this.name);
    };
    return Dog;
}());
var aa = new Dog("我是ts的开发者");
aa.eat();
var chengxu = /** @class */ (function () {
    function chengxu(name, age) {
        this.name = name;
        this.age = age;
    }
    chengxu.prototype.ear = function () { };
    return chengxu;
}());
var newChengxu = /** @class */ (function (_super) {
    __extends(newChengxu, _super);
    function newChengxu(bbb, aaa, file) {
        var _this = _super.call(this, bbb, aaa) || this;
        _this.file = file;
        return _this;
    }
    return newChengxu;
}(chengxu));
var newValue = new newChengxu("张三", 123, "李遂");
console.log(newValue.age);
var fun2 = function (num) {
    return num;
};
console.log(fun2(123456));
function getData(value) {
    return value;
}
var newFun = getData;
console.log(newFun("1213"));
